package com.corona.game;

import com.corona.Game;

/* compiled from: Action.java */
/* loaded from: pokewilds.jar:com/pkmngen/game/SetArrayAtIndex.class */
class SetArrayAtIndex extends Action {
    Object[] object;
    int index;
    Object setTo;

    public SetArrayAtIndex(Object[] object, int index, Object setTo, Action nextAction) {
        super(new Object[0]);
        this.nextAction = nextAction;
        this.object = object;
        this.index = index;
        this.setTo = setTo;
    }

    @Override // com.corona.game.Action
    public void step(Game game) {
        if (this.object != null) {
            try {
                this.object[this.index] = this.setTo;
            } catch (IllegalArgumentException e) {
                e.printStackTrace();
            } catch (SecurityException e2) {
                e2.printStackTrace();
            }
        }
        game.actionStack.remove(this);
        game.insertAction(this.nextAction);
    }
}
